﻿using BCDto.TMS.Packing.PackingCategoryConfig;
using BCService.TMS.Packing.PackingCategoryConfig;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace BCTMSRESTful.Controllers.ClientApp.Packing.PackingCategoryConfig
{
    /// <summary>
    /// 包装材料分类配置
    /// </summary>
    [Route("api/v1/ClientApp/[controller]")]
    [ApiExplorerSettings(GroupName = "ClientApp")]
    [AllowAnonymous]
    public class PackingCategoryConfigController : ClientAppBaseController
    {
        private readonly IPackingCategoryConfigService packingCategoryConfigService;

        public PackingCategoryConfigController(IPackingCategoryConfigService packingCategoryConfigService)
        {
            this.packingCategoryConfigService = packingCategoryConfigService;
        }

        /// <summary>
        /// 获取包装材料分类配置列表
        /// </summary>
        /// <response code="200">获取包装材料分类配置列表</response>
        /// <returns></returns>
        [HttpGet("[action]")]
        [ProducesResponseType(typeof(IEnumerable<PackingCategoryConfigDto>), 200)]
        public IActionResult List()
        {
            var result = this.packingCategoryConfigService.List(null);
            return this.Ok(result);
        }
    }
}
